package utils

import (
	beego "github.com/beego/beego/v2/server/web"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

var db2 *gorm.DB

func init() {
	var uri, _ = beego.AppConfig.String("sqlconn")
	db1, err := gorm.Open("mysql", uri)
	if err != nil {
		panic(err)
	}
	db2 = db1
}
func GetDB() *gorm.DB {
	return db2
}
